/*
 * Copyright (c) 2016. @huishenghuo.inf,Co,Limitid.
 */

package com.xiaoq.users.service;



import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.xiaoq.users.entity.UserEntity;
import com.xiaoq.users.repository.UserRepository;


@Service
@Transactional(readOnly = true)
public class UserService {

    private static Logger logger = LoggerFactory.getLogger(UserService.class);

    @Autowired
    private UserRepository userRepository;

    // 注入配置值
    @Value("${app.loginTimeoutSecs:600}")
    private int loginTimeoutSecs;


    public UserEntity getUserByID(String userId){
        return userRepository.getById(userId);
    }

    public UserEntity findUserByLoginAccount(String loginAccount) {
        return userRepository.findByLoginAccount(loginAccount);
    }

}
